package com.chris.vue.models.net;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * Created by Chris Chan
 * 2020/8/13 7:51
 * Use for:
 * Explain:
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class NetResult<T> {
    private int code;
    private String msg;
    private T data;

    public static <T> NetResult<T> ok(T data) {
        return new NetResult<>(0, "success", data);
    }

    public static <T> NetResult<T> error() {
        return new NetResult<>(1, "error", null);
    }
}
